import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue')
    },
    {
      path: '/',
      name: 'home-system',
      component: () => import('../views/Home.vue'),
      label: '管理面板',
      children: [
        {
          path: '/dashboard',
          name: 'dashboard',
          component: () => import('../views/Dashboard.vue'),
          label: '仪表盘',
          iconCls: 'fa fa-dashboard'
        },
        {
          path: '/user',
          name: 'user',
          component: () => import('../views/User.vue'),
          label: '用户管理',
          iconCls: 'fa fa-user-o'
        },
        {
          path: '/role',
          name: 'role',
          component: () => import('../views/Role.vue'),
          label: '角色管理',
          iconCls: 'fa fa-users'
        },
        {
          path: '/account',
          name: 'account',
          component: () => import('../views/Dashboard.vue'),
          label: '用户管理',
          iconCls: 'fa fa-users'
        }
      ]
    },
    {
      path: '/',
      component: () => import('../views/Home.vue'),
      name: 'home-item',
      label: '商品管理',
      children: [
        {
          path: '/shop',
          component: () => import('../views/Dashboard.vue'),
          name: 'shop',
          label: '店铺管理',
          iconCls: 'fa fa-industry'
        },
        {
          path: '/item',
          component: () => import('../views/Dashboard.vue'),
          name: 'item',
          label: '商品管理',
          iconCls: 'fa fa-cube'
        }
      ]
    },
    {
      path: '/',
      component: () => import('../views/Home.vue'),
      name: 'home-order',
      label: '订单管理',
      children: [
        {
          path: '/order',
          component: () => import('../views/Dashboard.vue'),
          name: 'order',
          label: '订单管理',
          iconCls: 'fa fa-book'
        },
        {
          path: '/order_item',
          component: () => import('../views/Dashboard.vue'),
          name: 'order_item',
          label: '订单统计',
          iconCls: 'fa fa-area-chart'
        }
      ]
    }
  ]
})

export default router
